package com.typhoon.spring_jdbctemplate.dao.ha;

/**
 * 负载均衡用的NodeBean
 *
 * @author Typhoon
 * @date 2017-09-17 13:58 Sunday
 * @since V2.0
 */
public class BalanceNodeBean {
    /**
     * Node Id节点id
     */
    private String nodeId = null;

    /**
     * Node配置的权重，默认是100
     */
    private float weight = 100;

    /**
     * 权重修正系数-1.0 - +1.0
     */
    private float correctionWeight = 0;

    /**
     * 当前权重，运行时的动态权值
     */
    private float currentWeight = 0;

    /**
     * 最大失败次数
     */
    private int maxFails = 0;

    /**
     * 多长时间内出现max_fails次失败便认为后端down掉了
     */
    private int failTimeout = 0;

    /**
     * Node的downFlag，默认是1
     */
    private int downFlag = 1;

    /**
     * Node的backupFlag，默认是0
     */
    private int backupFlag = 0;

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public float getCurrentWeight() {
        return currentWeight;
    }

    public void setCurrentWeight(float currentWeight) {
        this.currentWeight = currentWeight;
    }

    public float getCorrectionWeight() {
        return correctionWeight;
    }

    public void setCorrectionWeight(float correctionWeight) {
        this.correctionWeight = correctionWeight;
    }

    public int getDownFlag() {
        return downFlag;
    }

    public void setDownFlag(int downFlag) {
        this.downFlag = downFlag;
    }

    public int getMaxFails() {
        return maxFails;
    }

    public void setMaxFails(int maxFails) {
        this.maxFails = maxFails;
    }

    public int getFailTimeout() {
        return failTimeout;
    }

    public void setFailTimeout(int failTimeout) {
        this.failTimeout = failTimeout;
    }

    public int getBackupFlag() {
        return backupFlag;
    }

    public void setBackupFlag(int backupFlag) {
        this.backupFlag = backupFlag;
    }

}
